package com.yex.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yex.common.utils.PageUtils;
import com.yex.dao.DynamicDao;
import com.yex.entity.DynamicEntity;
import com.yex.service.DynamicService;
import com.yex.utils.Query;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.Map;


@Service("dynamicService")
public class DynamicServiceImpl extends ServiceImpl<DynamicDao, DynamicEntity> implements DynamicService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<DynamicEntity> page = this.selectPage(
                new Query<DynamicEntity>(params).getPage(),
                new EntityWrapper<DynamicEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public BigDecimal selectByTotal(Integer userId,Integer investmentId) {
        return baseMapper.selectByTotal(userId,investmentId);
    }
}
